install(CODE "execute_process(COMMAND bash -c \"cd ${PROJECT_SOURCE_DIR} && wget -q http://nginx.org/download/nginx-1.13.1.tar.gz && tar xf nginx-1.13.1.tar.gz\")")
install(CODE "execute_process(COMMAND bash -c \"cd ${PROJECT_SOURCE_DIR}/nginx-1.13.1 && ./configure --prefix=${PROJECT_SOURCE_DIR}/../nginxfc --with-ld-opt=\\\"-lstdc++ -L/usr/local/lib -L${PROJECT_SOURCE_DIR}/ffead-cpp-3.0-bin/lib\\\" --add-module=\\\"${PROJECT_SOURCE_DIR}/modules/nginx_mod_ffeadcpp\\\" --with-cc-opt=\\\"-I${PROJECT_SOURCE_DIR}/ffead-cpp-3.0-bin/include -I/usr/local/include/libmongoc-1.0 -I/usr/local/include/libbson-1.0 -I/usr/include/libmongoc-1.0 -I/usr/include/libbson-1.0 -w -fpermissive -std=gnu++11\\\"\")")
#install(CODE "execute_process(COMMAND bash -c \"sed -i'' -e 's|-o objs/addon/../ngx_http_ffeadcpp_module.o|@STDCXX_SWITCH@ -o objs/addon/../ngx_http_ffeadcpp_module.o|g' ${PROJECT_SOURCE_DIR}/nginx-1.13.1/objs/Makefile\")")
install(CODE "execute_process(COMMAND bash -c \"cd ${PROJECT_SOURCE_DIR}/nginx-1.13.1 && make && make install && cd ${PROJECT_SOURCE_DIR} && rm -rf nginx-1.13.1\")")
install(CODE "execute_process(COMMAND bash -c \"cp ${PROJECT_SOURCE_DIR}/modules/nginx_mod_ffeadcpp/nginx.conf ${PROJECT_SOURCE_DIR}/../nginxfc/conf/\")")
install(CODE "execute_process(COMMAND bash -c \"sed -i'' -e 's|FFEAD_PATH|'${PROJECT_SOURCE_DIR}/ffead-cpp-3.0'|g' ${PROJECT_SOURCE_DIR}/../nginxfc/conf/nginx.conf\")")
